<?php

	session_name("wlan");
	session_start();

	define("SET", true);

	/* load global functions */
	require_once("../../global/functions/error.php");
	require_once("../../global/functions/config.php");
	require_once("../../global/functions/tabfile.php");
	require_once("../../global/functions/xmlencode.php");

	/* load settings */
	loadConfig("../../../");




	if (isset($_GET['m'])) {
		$_m = preg_replace("@[^a-zA-Z0-9_]@", "", $_GET['m']);
	} else {
		$_m = "users";
	}
	
	if (isset($_GET['f'])) {
		$_f = preg_replace("@[^a-zA-Z0-9_]@", "", $_GET['f']);
	} else {
		$_f = $_m;
	}
	
	if (isset($_GET['export'])) {
		include "modules/system/export.php";
		die();
	}
	
	include "header.php";

	if ($_SESSION['loggedin']) {
		
		if (config("slave") AND $_m != "logs" AND $_m != "system" AND $_m != "login") {
			error("Diese Einstellungen können nur über den Hauptserver verwaltet werden.");
		} else {
		
			if (file_exists("modules/".$_m."/".$_f.".php")) {
				include "modules/".$_m."/".$_f.".php";
			} else error("Die angeforderte Datei wurde nicht gefunden");
			
		}
		
	} else {
		include "modules/login/login.php";
	}
	
	include "footer.php";


?>